<!-- 侧边栏 license by http://eleadmin.com -->
<template>
  <div class="ele-admin-sidebar ele-scrollbar-hide">
    <slot name="top"/>
    <div class="ele-admin-sidebar-menus">
      <el-menu
        :collapse="collapse"
        :default-active="menuActive"
        :collapse-transition="false"
        :unique-opened="sideUniqueOpen"
        :class="themeClass">
        <template v-for="menu in menuData">
          <my-sidebar-item
            v-if="!menu.meta.hide"
            :item="menu"
            :pop-class="themeClass"/>
        </template>
<!--        <template v-for="menu in menuData">-->
<!--          <my-sidebar-item-->
<!--            v-if="!menu.meta.hide"-->
<!--            :key="menu.path"-->
<!--            :item="menu"-->
<!--            :pop-class="themeClass"/>-->
<!--        </template>-->
      </el-menu>
    </div>
    <slot name="bottom"/>
  </div>
</template>

<script>
import MySidebarItem from '@/components/my-sidebar-item';
export default {
  name: 'MySidebar',
  components: {MySidebarItem},
  props: {
    // 侧边栏菜单数据
    menuData: Array,
    // 侧边栏菜单选中
    menuActive: String,
    // 是否折叠菜单
    collapse: Boolean,
    // 主题class, null | ele-menu-dark
    themeClass: String,
    // 侧边栏是否只保持一个子菜单展开
    sideUniqueOpen: Boolean
  }
}
</script>
